///引入共享头部
import '../../../common/shard.dart';

import 'package:widget_mask/widget_mask.dart';

class ImageShapePage extends StatelessWidget {
	const ImageShapePage({Key? key}) : super(key: key);

	static const shapeImg='https://segmentfault.com/img/bVXPSq';
	static const normalImg='https://segmentfault.com/img/bVXPSt';

	@override
	Widget build(BuildContext context) {
		return CustomCupertinoScaffold(
			titleText: "图片剪切蒙版",
			navBackgroundColor: Theme.of(context).primaryColor,
			body: Column(
				mainAxisAlignment: MainAxisAlignment.center,
				children: [
					Row(
						mainAxisAlignment: MainAxisAlignment.center,
						children: [
							Image.network(normalImg,width: 100,height: 100,fit: BoxFit.contain,),
							const SizedBox(width: 20),
							const Text("+",style: TextStyle(fontSize: 30)),
							const SizedBox(width: 20),
							Image.network(shapeImg,width: 100,height: 100,fit: BoxFit.contain,),
						],
					),
					const SizedBox(height: 20),
					WidgetMask(
						blendMode: BlendMode.screen,
						child: Image.network(shapeImg,width: 300,height: 300,fit: BoxFit.contain,),
						mask: Image.network(normalImg,width: 300,height: 300,fit: BoxFit.contain,),
					)
				],
			),
		);
	}
}
